<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
	input[type="text"]{
		font-size:20px;
	}
</style>
</head>
<body>
	<jsp:include page="header.jsp"></jsp:include>
	<div class="wrap">
	<!-- start login -->
	<section id="main">
		<div class="login-content">
			<div class="pag-nav">
				<ul class="p-list" style="font-size:24px">
					<li><a href="index.jsp" >首页</a></li>
					<li class="act">|</li>
					<li class="act">用户修改信息页</li>
				</ul>
			</div>
			<div class="login-signup-form">
			<form action="user" method="post">
				<div class="col-md-5 login text-center" style="border: 1px solid #D6D6D6;
				padding: 2em 0 0 0;min-height: 550px;width: 99.6%;">
					<h2>欢迎来到修改信息页页！</h2>
					<hr>
					<h4 id="mess" style="font-size:20px">${mess==null?"请修改你的信息！":mess }</h4>
					<hr>
					<div style="width:60%;margin: 0 auto;font-size:24px">
					<div class="cus_info_wrap">
						<label class="labelTop" style="line-height:24px;font-size:24px;width:100px">
						用户ID:
						</label>
						<input id="uid" type="text" name="uid" style="font-size:24px;height:40px;width:402px"
						 value="${user.uid}" required readonly>
					</div>
					<div class="clearfix"></div>
					<div class="cus_info_wrap">
						<label class="labelTop" style="line-height:24px;font-size:24px;width:100px">
						用户名:
						</label>
						<input id="uname" type="text" name="uname" style="font-size:24px;height:40px;width:402px"
						 value="${user.uname}" required placeholder="请输入2位以上的中文或数字和字母" pattern="(\w|[\u4e00-\u9fa5]){2,}$">
						<input id="oname" type="hidden" name="oname" value="${user.uname}" >
					</div>
					<div class="clearfix"></div>
					<div class="cus_info_wrap">
						<label class="labelTop" style="line-height:24px;font-size:24px;width:100px">
						电&nbsp;&nbsp;&nbsp;&nbsp;话:
						</label>
						<input id="uphone" type="text" name="uphone" 
						required placeholder="请输入11位的手机号" pattern="^1\d{10}$" 
						 style="font-size:24px;height:40px;width:402px"  value="${user.uphone}" >
					</div>
					<div class="clearfix"></div>
					<div class="cus_info_wrap">
						<label class="labelTop" style="line-height:24px;font-size:24px;width:100px">
						地&nbsp;&nbsp;&nbsp;&nbsp;址:
						</label>
						<input id="uaddress" type="text" name="uaddress" style="font-size:24px;height:40px ; width:402px" 
						value="${user.uaddress}" required placeholder="请输入详细地址" >
					</div>
					<div class="clearfix"></div>

					<div class="botton1">
						<input type="hidden" value="${user.upassword}" name="upassword"> 
						<input type="hidden" value="updateMess" name="action">  
						<input  style="background-color:#3498DB;width:200px;height: 50px;font-size:24px;margin-left:200px"
						 type="submit"  value="保存" id="regist" class="botton" ">
					</div>
				</div>
					
			</form>	
				</div>
				
				<div class="clearfix"></div>
			</div>
		</div>
		</section >
		<script>
		$(function() {
			$("#uname").blur(function(){
				//alert($(this).val());
				var oname=($("#oname").val());
				if($(this).val()==oname){
					$("#mess").html("请继续输入你的账号信息！");
					return;
				}
				$.ajax({
					url : "user",
					type : "post",
					data : {
						"action" : "checkUname_ajax",
						"uname" :$(this).val()
					},
					dataType : "text",
					success : function(result) {
						if (result == '1') {
							$("#mess").html("该用户名已存在！");
						} else {
							$("#mess").html("请继续输入你的账号信息！");
						}
					},
					error : function() {
						alert("系统发生错误，请联系管理员！");
					}
				})
			})
		}) 
		</script>
	<jsp:include page="bottom.jsp"></jsp:include>
</body>
</html>